<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>组件</title>
  <script src="../js/vue.js"></script>
</head>
<body>
  <div id="app">
    //3.使用组件
    <my-cpn></my-cpn>
  </div>
  <script>
    //1.创建构造器对象
    const cpnC = Vue.extend({
      template: `
        <div>
          <h2>我是标题</h2>
          <p>我是内容</p>
        </div>`
    })
    //2.注册组件
      //Vue.component('组件标签名',组件构造器)
      Vue.component('my-cpn',cpnC)

    const app = new Vue({  //对象类型
      el: '#app', //用于挂载要管理的元素
      data: {
        message: '你好'
      }
    })
  </script>
</body>
</html>